package com.teamwork.shareplatform.service.impl;

import com.teamwork.shareplatform.entity.Oneword;
import com.teamwork.shareplatform.mapper.OnewordMapper;
import com.teamwork.shareplatform.service.OnewordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OnewordServiceImpl implements OnewordService {

    @Autowired
    private OnewordMapper onewordMapper;

    @Override
    public List<Oneword> queryAll() {
        try {
            return onewordMapper.queryAll();
        } catch (Exception e) {
            // 这里可以使用日志框架记录异常，例如 SLF4J
            System.err.println("查询名人名言列表时出现异常: " + e.getMessage());
            return null;
        }
    }
}
